//
//  RequestOperation.m
//  huanqiu3.1
//
//  Created by 增值业务部 on 12-12-7.
//  Copyright (c) 2012年 增值业务部. All rights reserved.
//

#import "RequestOperation.h"


  @implementation RequestOperation
@synthesize message;
-(id)initWithRequest:(NSURLRequest *)request{

 if (self=[self init]) {
     _request=request;
        _data=[NSMutableData data];
 }
         return self;
}

    //如果返回为YES表示asychronously方式处理
   -(BOOL)isConcurrent{
    
        return YES;
    }
    //开始处理
   -(void)start{
         if (![self isCancelled]) {
        
             NSLog(@"%@",self.message);
            [NSURLConnection connectionWithRequest:_request delegate:self];
             }
    }
  //取得数据
-(void) connection:(NSURLConnection *)connection didReceiveData:(NSData *)data{
        //添加数据
         [_data appendData:data];  
        NSLog(@"%@",_data);  
       }  
   //http请求结束 
   -(void)connectionDidFinishLoading:(NSURLConnection *)connection{  
    }  
  @end